<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>尾迹转动 参考链接：http://www.bootstrapmb.com/item/11955</title>
</head>
<link rel="stylesheet" href="../common.css">
<style>
  section {
    width: 200px;
    height: 200px;
    position: relative;
  }

  .loader-ring {
    top: calc(50% - 100px);
    left: 50%;
    pointer-events: none;
  }

  #long-tail {
    visibility: hidden;
  }

  .btn {
    position: absolute;
    cursor: pointer;
    min-width: 90px;
    min-height: 90px;
    line-height: 90px;
    background: #25292C;
    margin: auto auto;
    top: calc(50% - 50px);
    left: calc(50% - 50px);
    text-align: center;
    border-radius: 999px;
    color: rgba(155, 155, 155, 1);
    text-shadow: -1px -1px 0px rgba(255, 255, 255, 0.8), 1px 1px 2px rgba(0, 0, 0, 1);
    font-family: sans-serif;
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.3),
      inset 3px 15px 45px rgba(255, 255, 255, 0.1),
      inset -1px -1px 2px rgba(0, 0, 0, 0.5),
      inset -3px -15px 45px rgba(0, 0, 0, 0.2),
      1px 5px 30px -4px rgba(0, 0, 0, 1);
    transition: 0.1s ease-out;
  }

  .btn:before {
    content: "";
    cursor: pointer;
    background: #1A1A1A;
    width: 120px;
    height: 120px;
    position: absolute;
    top: -15px;
    left: -15px;
    z-index: -99;
    border-radius: 999px;
    box-shadow: inset -1px -1px 2px rgba(255, 255, 255, 0.3),
      inset -5px -15px 40px rgba(255, 255, 255, 0.1),
      inset 1px 1px 2px rgba(0, 0, 0, 0.5),
      inset 5px 15px 40px rgba(0, 0, 0, 0.2),
      -2px -40px 50px -20px rgba(255, 255, 255, 0.1),
      2px 35px 50px -10px rgba(0, 0, 0, 0.4),
      0px 0px 25px 8px rgba(60, 60, 60, 1);
  }

  .btn:active,
  input:checked+.btn {
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.15);
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.3),
      inset 3px 15px 45px rgba(0, 0, 0, 0.2),
      inset -1px -1px 2px rgba(0, 0, 0, 0.5),
      inset -3px -15px 45px rgba(255, 255, 255, 0.1),
      1px 5px 10px -4px rgba(0, 0, 0, 1);
  }

  a {
    font-family: arial, sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    position: fixed;
    bottom: 0;
    right: 0;
    margin: 5px;
    color: #555;
  }

  a:hover {
    color: #888;
  }

  b {
    position: absolute;
    left: 50%;
    margin-right: -50%;
    transform: translateX(-50%);
    top: calc(50% - 200px);
    color: rgba(155, 155, 155, 1);
    font-family: sans-serif;
  }


  .loader-ring {
    position: absolute;
    height: 100px;
    width: 100px;
    border-radius: 0 100% 0 0;
    border: 1px solid white;
    border-width: 0px 5px 0px 0px;
    box-shadow: 5px 1px 2px -4px white, inset -4px 1px 3px -4px white;
    transform-origin: 0px 100%;
    animation: rotate 1s linear infinite;
  }

  .loader-ring:after {
    position: absolute;
    height: 1px;
    width: 1px;
    top: 100%;
    left: calc(100% + 2px);
    border-radius: 100%;
    border-width: 0;
    background: white;
    box-shadow: 0px 0 3px 5px white;
    content: '';
  }

  #long-tail:checked~.loader-ring:before {
    position: absolute;
    height: 200%;
    width: 200%;
    top: -1px;
    left: calc(-100% - 1px);
    border-radius: 100%;
    border: 1px solid rgba(255, 255, 255, .5);
    border-width: 1px 0 0;
    transform-origin: 0px 0px;
    content: '';
  }

  #long-tail:checked~.loader-ring {
    animation-duration: .8s;
  }

  @keyframes rotate {
    to {
      transform: rotate(360deg);
    }
  }

  /* 第二个动画 */
  .ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    background: transparent;
    border: 3px solid #3c3c3c;
    border-radius: 50%;
    text-align: center;
    line-height: 150px;
    font-family: sans-serif;
    font-size: 20px;
    color: #fff000;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 10px #fff000;
    box-shadow: 0 0 20px rgba(0, 0, 0, .5);
  }

  .ring:before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid #fff000;
    border-right: 3px solid #fff000;
    border-radius: 50%;
    animation: animateC 2s linear infinite;
  }

  span {
    display: block;
    position: absolute;
    top: calc(50% - 2px);
    left: 50%;
    width: 50%;
    height: 4px;
    background: transparent;
    transform-origin: left;
    animation: animate 2s linear infinite;
  }

  span:before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff000;
    top: -6px;
    right: -8px;
    box-shadow: 0 0 20px #fff000;
  }

  @keyframes animateC {
    0% {
      transform: rotate(0deg);
    }

    100% {
      transform: rotate(360deg);
    }
  }

  @keyframes animate {
    0% {
      transform: rotate(45deg);
    }

    100% {
      transform: rotate(405deg);
    }
  }
</style>

<body>
  <section>
    <input id="long-tail" type="checkbox"><label for="long-tail" class="btn">susu </label>
    <div class="loader-ring"></div>
  </section>
  <section>
    <div class="ring">Loading
      <span></span>
    </div>
  </section>

</body>

</html>